<?php

namespace App\Providers;

use EasyWeChat\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use Overtrue\Socialite\SocialiteManager;

class WeChatServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //微信登录
        $this->app->singleton(SocialiteManager::class, function ($app){
            return new SocialiteManager(config('open-wechat-client'));
        });
        //微信开放平台
        $this->app->singleton(Application::class, function ($app){
            return new Application(config('wechat'));
        });
    }
}
